let brandTitleid = getQueryString('brandTitleid')
let categoryid = getQueryString('categoryid')
console.log(categoryid)
// let title=getQueryString('title')
fetch(`http://chst.vip:1234/api/getproductlist?categoryid=${categoryid}&brandTitleid=${brandTitleid}`)
    .then(body => body.json())
    .then(res => {
        let el = ''
        let ss = ''
        res.result.forEach(item => {
            el += `<li class="info" productid=${item.productId} categoryid=${item.categoryId}>
        <a href="#">
            <div class="info_l">
                ${item.productImg}
            </div>
            <div class="info_r">
                <h4>${item.productName}</h4>
                <p class="price">${item.productPrice}</p>
                <div class="other">
                    <p>${item.productQuote}</p>
                    <img src="../images/评论.png" alt="">
                    <p>${item.productCom}</p>
                </div>
            </div>
        </a>
    </li>`
        })

        $('.uls').html(el)
    })

fetch(`http://chst.vip:1234/api/getcategorybyid?categoryid=${categoryid}&brandTitleid=${brandTitleid}`)
    .then(body => body.json())
    .then(res => {
        // console.log(res.result[0])
        let el = (res.result[0].category)
        $('.tv').html(el)
    })


$('.uls').on('click', 'li', function () {
    // console.log(this)
    let productid = $(this).attr('productid')
    let categoryid=$(this).attr('categoryid')
    location.href = `../pages/particulars.html?productid=${productid}&categoryid=${categoryid}`
})